<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>平台商</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://at.alicdn.com/t/font_1440001_47llmi4hsil.css" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/user.css">
    <link rel="stylesheet" href="css/media.css">
</head>

<body>
    <div id="header"></div>
    
    <div class="m-header hidden-lg hidden-md hidden-sm">
        <div class="nav-left">
            <div class="btn-burger navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </div>
        </div>
        <div class="wrapper___2_acE"></div>
        <!-- <div class="user-dropmenu-mask"></div> -->
        <div class="user-dropmenu" style="height:0px;opacity: 1;top: 50px;">
            <div class="search">
                <div class="input-group">
                    <span class="input-group-addon glyphicon glyphicon-search" id="basic-addon1"></span>
                    <input type="text" class="form-control" placeholder="搜索" aria-describedby="basic-addon1">
                </div>
            </div>
            <ul class="ant-menu">
                <li>
                    <div class="ant-menu-submenu-title">工作台</div>
                    <ul class="ant-menu-inline">
                        <li class="ant-menu-item"><a href="index.html" class="active">首页</a></li>
                        <li class="ant-menu-item"><a href="platform.html" class="">平台商</a></li>
                        <li class="ant-menu-item"><a href="industry.html" class="">行业雷达</a></li>
                        <li class="ant-menu-item"><a href="market.html" class="">市场雷达</a></li>
                        <li class="ant-menu-item"><a href="index.html" class="">行业活动</a></li>
                        <li class="ant-menu-item"><a href="index.html" class="">雷达广场</a></li>
                    </ul>
                </li>
                <li class="ant-menu-item"><a href="#" style="background: #fff;">帮助</a></li>
                <li class="ant-menu-item"><a href="#" style="background: #fff;">发现</a></li>
            </ul>
            <ul class="ant-menu">
                <li class="ant-menu-item"><a href="#" style="background: #fff;">个人页面</a></li>
                <li class="ant-menu-item"><a href="#" style="background: #fff;">退出</a></li>
            </ul>
        </div>
    </div>
    <!-- 主体 -->
    <section class="plats">
        <div class="container">
            <!-- 全部 热门平台  黑平台 -->
            <nav class="navbar navbar-default">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav" id="tab-list">
                        <li class="active"><a href="javaScript:;">全部</a></li>
                        <li><a href="javaScript:;">普通商户</a></li>
                        <li><a href="javaScript:;">热门商户</a></li>
                        <li><a href="javaScript:;">黑商户</a></li>
                    </ul>
                </div>
            </nav>
            <div class="row" id="item-list">
            </div>
        </div>
    </section>
    <div id="footer"></div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"> </script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/mine.js"></script>
<script src="js/core.js"></script>
<script>
$(function() {
    $("#header").load("./header.html")
    $("#footer").load("./footer.html")
    let countrylist = [{ id: 2, name: "中国" }, { id: 1, name: "美国" }, { id: 3, name: "英国" }, { id: 4, name: "德国" }, { id: 5, name: "法国" }];
    let type = -1;
    let current = 1;
    let item0 = "";
    // 国家列表
    let countryItem = "";
    $.each(countrylist, function(index, val) {
        countryItem += `<li><input type="checkbox" name="item" id="i${val.id}" value="${val.name}"><label for="i${val.id}">${val.name}</label></li>`;
    })
    $(".country-list").html(countryItem);
    // 提交请求
    $("#select-btn").click(function() {
        let country = "";
        let radarScore = "";
        $.each($(".country-list li input[type=checkbox]:checked"), function(index, val) {
            console.log($(this).val())
            country += $(this).val() + '-';
        })
        radarScore = $("#radarScore1").val() + "-" + $("#radarScore2").val();
        Getdata(busList, { type, size: 16, current, radarScore, country }).then(res => {
            console.log(res)
            let items = "";
            $.each(res.data.records, function(index, val) {
                items += `<div class="col-md-3 col-sm-6 col-xs-12">
                    <div class="plat-item">
                        <div class="img"><a href="platDetail.html?id=${val.id}"><img class="img-responsive center-block" src="${val.imgPath}" alt=""></a><span>监督中</span></div>
                        <div class="item-info">
                            <a href="platDetail.html?id=${val.id}">
                                <p class="tit">${val.name}</p>
                            </a>
                            <p class="label">
                                <span class="span-group"><span class="s1">雷达评分</span><span class="s2">${val.radarScore}</span></span>
                            </p>
                            
                        </div>
                    </div>
                </div>`;
            })
            $("#item-list").html(items);
        })

    })


    // 默认请求全部平台item-list
    Getdata(busList, { type, size: 16, current }).then(res => {
        console.log(res)
        $.each(res.data.records, function(index, val) {
            item0 += `<div class="col-md-3 col-sm-6 col-xs-12">
                    <div class="plat-item">
                        <div class="img"><a href="platDetail.html?id=${val.id}"><img class="img-responsive center-block" src="${val.imgPath}" alt=""></a><span>监督中</span></div>
                        <div class="item-info">
                            <a href="platDetail.html?id=${val.id}">
                                <p class="tit">${val.name}</p>
                            </a>
                            <p class="label">
                                <span class="span-group"><span class="s1">雷达评分</span><span class="s2">${val.radarScore}</span></span>
                            </p>
                            
                        </div>
                    </div>
                </div>`;
        })
        $("#item-list").html(item0);
    })
    // 点击tab切换平台类型tab-list    
    $.each($("#tab-list li"), function(index, val) {
        $("#tab-list li").eq(index).click(function() {
            let item1 = "";
            $(this).addClass("active").siblings().removeClass("active");
            if (index == 0) {
                type = -1;
            } else {
                type = index;
            }
            Getdata(busList, { type, size: 16, current }).then(res => {
                console.log(res)
                $.each(res.data.records, function(index, val) {
                    item1 += `<div class="col-md-3 col-sm-6 col-xs-12">
                    <div class="plat-item">
                        <div class="img"><a href="platDetail.html?id=${val.id}"><img class="img-responsive center-block" src="${val.imgPath}" alt=""></a><span>监督中</span></div>
                        <div class="item-info">
                            <a href="platDetail.html?id=${val.id}">
                                <p class="tit">${val.name}</p>
                            </a>
                            <p class="label">
                                <span class="span-group"><span class="s1">雷达评分</span><span class="s2">${val.radarScore}</span></span>
                            </p>
                            
                        </div>
                    </div>
                </div>`;
                })
                $("#item-list").html(item1);
            })

        })
    })



















})
</script>

</html>